<?php

namespace app\mall\ui\table;

use app\mall\enum\MAllStoreStatusEnum;
use app\mall\model\MallStoreLevelSetting;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 门店管理表格
 */
class MallStoreTable extends TableInterface
{
    public function header()
    {
        return [
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 80],
            'logo' => ['label' => 'LOGO', 'type' => 'image', 'width' => 80],
            'status_text' => ['label' => '状态', 'field' => 'status', 'filter' => MAllStoreStatusEnum::toZhArray(), 'width' => 100],
            'level_text' => ['label' => '门店等级', 'field' => 'level_flag', 'filter' => MallStoreLevelSetting::buildLevelKeyValue(), 'width' => 100],
            'name' => ['label' => '门店名称'],
            'address' => ['label' => '地址'],
            'create_time' => ['label' => '创建时间', 'sort' => true, 'width' => 160]
        ];
    }

    public function filters()
    {
        return [
            'name' => ['label' => '门店名称', 'type' => 'text'],
            'create_time' => ['label' => '创建时间', 'type' => 'daterange'],
        ];
    }

}